/*
 * @Author: Wushiqi
 * @Descripttion: 用户管理相关接口
 * @Date: 2020-08-26 18:17:42
 * @LastEditor: Wushiqi
 * @LastEditTime: 2021-05-25 15:20:35
 */
import { get, post, put } from '@/utils/http'

// 用户列表
const userListAPI = (params) => get('/user/userList', params)
// 用户信息
const userInfoAPI = (params) => get('/user/userList', params)
// 新增用户
const addUserAPI = (params) => post('/user/add', params)
// 修改用户
const updateUserAPI = (params) => put('/user/updateUser', params)
// 重置密码
const resetPwdAPI = (params) => put('/user/resetPassword', params)
// 启用、禁用
const userEnableAPI = (url, params) => put('/user/' + url, params)

// 角色配置
// 获取已配置/可选角色列表
const roleListAPI = (params) => get('/user/userConfigRoles', params)
// 新增addUserRoles/删除deleteUserRoles用户角色
const addRoleAPI = (url, params) => put('/user/' + url, params)

export default {
  userListAPI,
  userInfoAPI,
  addUserAPI,
  updateUserAPI,
  resetPwdAPI,
  userEnableAPI,
  roleListAPI,
  addRoleAPI
}
